<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<h1 align="center" style="font-family: 仿宋">{{ request.session.s.stuName }} <a href="{% url 'line_chart' %}" style="text-decoration: none;color: #ff0000; font-family: 仿宋">成绩分析</a></h1>
<p><a href="{% url 'download' %}">下载</a></p>

<table class="table table-striped">
    <tr>
        <td>学期</td>
        {% for i in klist %}
            <td><a href="{% url 'brokenline' c_id=i.id %}">{{ i.kname }}</a></td>
        {% endfor %}
    </tr>
        {% for i in clist %}
        <tr>
            <td>第{{ forloop.counter }}学期</td>
            {% for j in i %}
                <td>{{ j }}</td>
            {% endfor %}
        </tr>
        {% endfor %}

</table>
<h1 style="color: red; font-family: 仿宋" align="center">未及格科目及成绩</h1>
<table style="width: 40%;text-align: center" align="center" class="table table-bordered table-striped">
    <tr>
        <td>科目</td>
        <td>成绩</td>
        <td>学期</td>
    </tr>
    {% for w in contacts %}
        <tr>
            <td>{{ w.kid.kname }}</td>
            <td>{{ w.cj }}</td>
            <td>{{ w.tid.tname }}</td>
        </tr>
    {% endfor %}
</table>
<div class="pagination" style="padding-left: 810px">
    <span class="step-links">
        {% if contacts.has_previous %}
            <a href="?page=1">&laquo; 首页</a>
            <a href="?page={{ contacts.previous_page_number }}">上一页</a>
        {% endif %}

        <span class="current">
            页数 {{ contacts.number }} / {{ contacts.paginator.num_pages }}
        </span>

        {% if contacts.has_next %}
            <a href="?page={{ contacts.next_page_number }}">下一页</a>
            <a href="?page={{ contacts.paginator.num_pages }}">最后一页 &raquo;</a>
        {% endif %}
    </span>
</div>
</body>
</html>